import { defineStore } from 'pinia';
import { ref, computed } from 'vue';

export const useSettingStore = defineStore('setting',()=>{
    // 是否展开
    let isExpand = ref(true);
    let isDark = ref(false);
    let themeColor = ref('#409EFF');
    const handleExpand = () => {
        isExpand.value = !isExpand.value;
    }
    //刷新
    let refresh = ref(false);
    const handleRefresh = () => {
        refresh.value = !refresh.value;
    }
    const themeClass = computed(() => isDark.value ? 'dark-theme' : '');
    return {
        isExpand,
        handleExpand,
        refresh,
        handleRefresh,
        isDark,
        themeClass,
        themeColor
    }
})
